1. Field
The disclosed embodiments generally relate to techniques for connecting to Wi-Fi® networks.
2. Related Art
Smartphone applications, such as email clients and web browsers, often require an available Internet connection as soon as the user launches the application on the device. Such applications then use the connection to access web pages, email, and other online content. Smartphones generally use either a cellular or Wi-Fi connection to access the Internet. Moreover, applications typically prioritize Wi-Fi connections over cellular connections because Wi-Fi is typically cheaper and faster than cellular connectivity. Thus, users benefit when smartphones stay connected to Wi-Fi networks as much as possible.
Implementing this behavior in a device, however, introduces a unique problem, particularly when the mobile device goes outside the range of the Wi-Fi network's access point and loses the device's Wi-Fi connection. In order to regain a Wi-Fi connection to the Internet, the device may need to discover and associate with a Wi-Fi access point that the device “knows” (possesses security credentials for). Once a device leaves the range of an access point, the device may not know how far away the access point is. As a result, the device scans for access points repeatedly at a constant frequency.
However, mobiles devices have limited battery power, and the process of scanning for access points consumes power. Thus, in setting the scanning frequency, the mobile device tries to balance the need to conserve power with the need to regain a Wi-Fi connection as soon as the device is in range of an access point. Setting the scanning frequency too low may prevent the device from quickly discovering an access point once the device is in range. On the other hand, setting the scanning frequency too high may quickly drain the device's battery. Both scenarios degrade the user's experience.